import { EntitySchema } from '@mikro-orm/core';

export class LeGoodsBody {
  id!: string;
  goodsId!: string;
  content?: unknown;
  createdTime!: string;
  updatedTime?: string;
  deletedTime?: string;
  isDeleted: boolean = false;
  goodsIntroduce?: string;
  goodsArgs?: string;
}

export const LeGoodsBodySchema = new EntitySchema({
  class: LeGoodsBody,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    goodsId: { type: 'string', columnType: 'bigint', index: '商品id' },
    content: { type: 'unknown', columnType: 'longtext', nullable: true },
    createdTime: { type: 'string', columnType: 'bigint' },
    updatedTime: { type: 'string', columnType: 'bigint', nullable: true },
    deletedTime: { type: 'string', columnType: 'bigint', nullable: true },
    isDeleted: { type: 'boolean', default: false },
    goodsIntroduce: { type: 'string', length: 255, nullable: true },
    goodsArgs: { type: 'string', columnType: 'text', nullable: true },
  },
});
